package com.eptok.demo.project.controller;

import javax.annotation.Resource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.eptok.demo.project.service.api.DemoService;

@Controller
//@RequestMapping("/demo")
public class DemoController{
    private Log log = LogFactory.getLog(DemoController.class);

    @Resource
    DemoService demoService;

    @RequestMapping(value = "/index.do", method = RequestMethod.GET)
    @ResponseBody
    public Object index() {
        String hello = demoService.sayHello("Dubbo Service");
        log.info("---index---");
        return hello;
    }
    
    @RequestMapping(value = "/home.do", method = RequestMethod.GET)
    @ResponseBody
    public Object home() {
        log.info("---home---");
        return "hello world";
    }
}
